DeleteFolder
Definition:
DeleteFolder(path)
Description:
Delete a local folder and any subfolders and files below it from the mobile device.
Platforms:
All
Parameters:
path - required

Specify the fully qualified path of the folder to delete.

Specify one of the following values:
""
Specify an empty string to allow the user to browse for and select the folder to be deleted at runtime.
Documents\<subfolderpath>
Specify the path of a folder located in the device's Documents library, or one of its subfolders, using this special format, e.g. Documents\MyApp\DataFiles. To use this option requires permission to directly access the device's Documents library - see Notes below.
Returns:
nothing
Notes:

On the Universal Windows Platform, note the following:
-
If you are creating a Standalone App and you want to directly access folders in the device's Document library using this Method, you will need to turn on this capability within the build request to the Digitise Apps Build System. You do this by selecting the Access Documents Library option under the Permissions tab when configuring the Standalone App build request in App Studio. If you select Access Documents Library, you then need to create a list of file extensions determining which files in the Documents library the Scripting Methods are allowed to operate on.
Note that when creating a store version of a Standalone App, selecting Access Documents Library affects the process by which you submit the app to the Store and requires you to justify your use of this option to Microsoft.
For a pre-configured version of the Universal Windows Client, Access Documents Library is always selected and you only need to specify a list of file extensions, determining which files in the Documents library the Scripting Methods are allowed to operate on, under the File Extensions tab in the build request.
You can only specify a file using the Documents\<subfolderpath> format as a parameter to this Method if Access Documents Library is selected.
If the specified folder, or any of its subfolders, contain files, these files will only be deleted if they have file extensions included in your file extensions list specified in the build request. If it contains files with unlisted file extensions the Method will fail silently. On a Windows tablet, if you have not specified any file extensions, the folder will only be deleted if it is empty. On a Windows desktop, you must always specify at least one file extension (see below).
The standard NDL-signed Digitise Apps Client supplied in the Digitise Apps Product Download, has Access Documents Library disabled and cannot directly access folders in the Documents library.
-
If you specify an empty string as the parameter to this Method, on a Windows tablet, generally the user can delete any folder which the operating system will allow them to select. However, in some situations, the user may be able to select a folder which cannot be deleted, e.g. because it has open files within it. In this situation, the Method will fail silently.
-
If you will be running your app in a Windows desktop environment, you can only use the DeleteFolder Method if you have Access Documents Library selected, as described above and you must also have at least one file extension listed in the File Extension table. This is true, whether you want to specify an empty string or a folder in the Documents library as the parameter to this Method. When specifying an empty string as the parameter or if you will only be deleting empty folders within the Documents library, it doesn't matter what file extensions are listed in the file extensions table, as long as there is at least one. In addition, in all cases, you can only delete folders within the Documents library.
-
When you delete a folder, any files within the folder and any subfolders will be deleted as well.